package com.platformer.screens;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.platformer.PlatformerGame;

public class AbstractScreen implements Screen {

	protected Game game;
	protected SpriteBatch batch;
	
	
	public AbstractScreen(Game game) {
		this.game = game;
		this.batch = new SpriteBatch();
	}

	@Override
	public void render(float delta) {
		// TODO Auto-generated method stub

	}

	@Override
	public void resize(int width, int height) {
		Gdx.app.log(PlatformerGame.LOG, "resizing screen: " + getScreenName()
				+ " to " + width + "x" + height);
	}

	@Override
	public void show() {
		Gdx.app.log(PlatformerGame.LOG, "showing screen: " + getScreenName());
	}

	@Override
	public void hide() {
		Gdx.app.log(PlatformerGame.LOG, "hiding screen: " + getScreenName());
	}

	@Override
	public void pause() {
		Gdx.app.log(PlatformerGame.LOG, "hiding screen: " + getScreenName());
	}

	@Override
	public void resume() {
		Gdx.app.log(PlatformerGame.LOG, "resuming screen: " + getScreenName());
	}

	@Override
	public void dispose() {
		Gdx.app.log(PlatformerGame.LOG, "disposing screen: " + getScreenName());
		
		if(batch != null) {
			batch.dispose();
		}
	}

	
	public String getScreenName() {
		return getClass().getSimpleName();
	}

}
